var UTYPE = { //用户类型
    ADMIN: 0, //平台管理员
    OPERATION: 10, //总部运营人员
    SUPPORTER: 15, //教学支持人员
    PROVIDER: 20, //课程提供商
    TEACHER: 200, //讲师
    TUTOR: 201, //辅导老师
    SERVICER: 202, //客服
    PRODUCTION: 203, //课件制作人员
    HR: 30, //企业HR
    STUDENT: 40, //正式学员
    STUDENT_ENTER: 401, //报名学员
    STUDENT_TRY: 402, //试用学员
    SALESMAN: 50, //渠道
    VISITOR: 1000 //游客
},
STATUS = { //各种状态
	UNPUBLISH: 0,
    COMMIT: 1, //提交
    UNCOMMIT: 2, //未提交
    PASS: 3, //通过
    REJECT: 4, //拒绝
    SHELVES: 5, //上架
    UNDERCARRIAGE: 6, //下架
    UNREAD: 7, //未读
    READ: 8, //已读
    VERIFYING: 9, //审核中
    ACTIVE: 10, //学员激活
    UNACTIVE: 11, //学员未激活
    CERTIFICATE_COMMIT: 20, //纸质证书申请
    CERTIFICATE_PASS: 21, //纸质证书通过
    CERTIFICATE_REJECT: 22, //纸质证书拒绝
    CERTIFICATE_FINISH: 23//纸质证书发放完
},
MEDIA = { //交流内容类型
    TYPE_TEXT: 0, //0:文字
    TYPE_PIC: 1, //1:图片
    TYPE_VOICE: 2, //2:语音
},
MAX = 500000;
var USER_ROLE = {};
USER_ROLE[UTYPE.ADMIN] = [UTYPE.OPERATION];
//去掉创建HR功能
//USER_ROLE[UTYPE.OPERATION] = [UTYPE.PROVIDER, UTYPE.HR, UTYPE.SALESMAN];
USER_ROLE[UTYPE.OPERATION] = [UTYPE.PROVIDER, UTYPE.SALESMAN, UTYPE.STUDENT, UTYPE.SUPPORTER];
USER_ROLE[UTYPE.SUPPORTER] = [UTYPE.STUDENT];
USER_ROLE[UTYPE.PROVIDER] = [UTYPE.TUTOR, UTYPE.PRODUCTION];
USER_ROLE[UTYPE.SALESMAN] = [UTYPE.HR, UTYPE.STUDENT];
USER_ROLE[UTYPE.TUTOR] = [UTYPE.STUDENT];
USER_ROLE[UTYPE.HR] = [UTYPE.STUDENT];

var UTYPE_LABEL = {};
// UTYPE_LABEL[UTYPE.ADMIN] = "平台管理员";
UTYPE_LABEL[UTYPE.OPERATION] = "总部运营人员";
UTYPE_LABEL[UTYPE.PROVIDER] = "课程提供商";
UTYPE_LABEL[UTYPE.TEACHER] = "讲师";
UTYPE_LABEL[UTYPE.TUTOR] = "辅导老师";
UTYPE_LABEL[UTYPE.SERVICER] = "客服";
UTYPE_LABEL[UTYPE.PRODUCTION] = "课件制作人员";
UTYPE_LABEL[UTYPE.HR] = "企业HR";
UTYPE_LABEL[UTYPE.STUDENT] = "正式学员";
UTYPE_LABEL[UTYPE.SUPPORTER] = "教学支持";
// UTYPE_LABEL[UTYPE.STUDENT_ENTER] = "报名学员";
// UTYPE_LABEL[UTYPE.STUDENT_TRY] = "试用学员";
UTYPE_LABEL[UTYPE.SALESMAN] = "渠道";

var Menu = {}
Menu[UTYPE.ADMIN] = [
	{
		name: "用户管理",
		child: [
			{
				name:"创建用户",
				url:"userCreate"
			},
			{
				name:"用户列表",
				url:"userList"
			}
		]
	}
];
Menu[UTYPE.OPERATION] = [
	{
		name: "用户管理",
		child: [
			{
				name:"创建用户",
				url:"userCreate"
			},
			{
				name:"用户列表",
				url:"userList"
			}
		]
	},
	{
		name:"订单管理",
		url: "orderList"
	},
	{
		name: "证书管理",
		child: [
			{
				name:"创建证书",
				url:"certificateCreate"
			},
			{
				name:"管理证书",
				url:"certificateList"
			},
			{
				name:"申请证书",
				url:"certificateVerify"
			},
			{
				name:"证书类型管理",
				url:"certificateTypeList"
			}
		]
	},
	{
		name:"课程管理",
		child: [
			{
				name:"创建课程",
				url:"courseCreate"
			},
			{
				name:"课程列表",
				url:"courseList"
			},
		]
	},
	{
		name:"题库管理",
		url:"quesBank"
	},
	{
		name:"学习管理",
		url:"studyList"
	},
	{
		name:"发票管理",
		url:"certificateInvoice_Manger"
	},
	{
		name:"首页设置",
		child: [
			{
				name:"推荐证书",
				url:"indexSetCertificate"
			},
			{
				name:"推荐课程",
				url:"indexSetCourse"
			},
			{
				name:"推荐讲师",
				url:"indexSetTeacher"
			},
		]
	},
	{
		name: "班级管理",
		child: [
			{
				name:"创建班级",
				url:"classCreate"
			},
			{
				name:"班级列表",
				url:"classList"
			},
		]
	},
	{
		name: "支付管理",
		child: [
			{
				name:"课程",
				url:"payoder"
			},
			{
				name:"证书",
				url:"payoder_1"
			}
			// ,
			// {
			// 	name:"发票",
			// 	url:"payoder_2"
			// },
			// {
			// 	name:"专业",
			// 	url:"payoder_3"
			// }
		]
	}
];
Menu[UTYPE.SUPPORTER] = [
	{
		name: "用户管理",
		child: [
			{
				name:"创建用户",
				url:"userCreate"
			},
			{
				name:"用户列表",
				url:"userList"
			}
		]
	},
	{
		name: "证书管理",
		child: [
			// {
			// 	name:"创建证书",
			// 	url:"certificateCreate"
			// },
			// {
			// 	name:"管理证书",
			// 	url:"certificateList"
			// },
			{
				name:"申请证书",
				url:"certificateVerify"
			}
			// ,
			// {
			// 	name:"证书类型管理",
			// 	url:"certificateTypeList"
			// }
		]
	},
	{
		name:"课程管理",
		child: [
			// {
			// 	name:"创建课程",
			// 	url:"courseCreate"
			// },
			{
				name:"课程列表",
				url:"courseList"
			},
		]
	},
	{
		name:"题库管理",
		url:"quesBank"
	},
	{
		name:"学习管理",
		url:"studyList"
	},
	{
		name:"发票管理",
		url:"certificateInvoice_Manger"
	},
	{
		name: "班级管理",
		child: [
			{
				name:"公告管理",
				url:"noticeManager"
			},
			{
				name:"权重管理",
				url:"weightManger"
			},
			{
				name:"评论管理",
				url:"commentManger"
			},
			{
				name:"课程教学",
				url:"courseware"
			},
			// {
			// 	name:"课程考核",
			// 	url:"course_check"
			// },
			{
				name:"辅导老师管理",
				url:"tutorManger"
			},
		]
	},
	{
		name:"辅导老师考核",
		child:[{
			name:"考核比重设置",
			url:"teaching_coach_proportion"
		},{
			name:"考核结果管理",
			url:"tutorAssRes"
		}]
	}
];
Menu[UTYPE.PROVIDER] = [
	{
		name: "用户管理",
		child: [
			{
				name:"创建用户",
				url:"userCreate"
			},
			{
				name:"用户列表",
				url:"userList"
			}
		]
	},
	{
		name: "讲师管理",
		child: [
			{
				name:"创建讲师",
				url:"teacherCreate"
			},
			{
				name:"讲师列表",
				url:"teacherList"
			}
		]
	},
	{
		name:"课程管理",
		url:"courseList"
	},
	{
		name:"题库管理",
		url:"quesBank"
	},
	{
		name:"学习管理",
		url:"studyList"
	}
];
Menu[UTYPE.SALESMAN] = [
	{
		name: "用户管理",
		child: [
			{
				name:"创建用户",
				url:"userCreate"
			},
			{
				name:"用户列表",
				url:"userList"
			}
		]
	},
	{
		name:"订单管理",
		child:[
			{
				name:"创建订单",
				url:"orderCreate"
			},
			{
				name:"订单列表",
				url:"orderList"
			}
		]
	},
	{
		name:"学习管理",
		url:"salesMan"
 	}
];
Menu[UTYPE.PRODUCTION] = [
	{
		name:"课程管理",
		url:"courseList"
	},
	{
		name:"题库管理",
		url:"quesBank"
	}
];
Menu[UTYPE.HR] = [
	{
		name: "用户管理",
		child: [
			{
				name:"用户列表",
				url:"userList"
			}
		]
	},
	{
		name:"学习管理",
		url:"studyList"
	}
];
Menu[UTYPE.TUTOR] = [
	// {
	// 	name: "用户管理",
	// 	child: [
	// 		// {
	// 		// 	name:"创建用户",
	// 		// 	url:"userCreate"
	// 		// },
	// 		{
	// 			name:"用户列表",
	// 			url:"userList"
	// 		}
	// 	]
	// },
	{
		name:"文档说明",
		child:[
			{
				name:"课程辅导建议",
				url:"currGuid"
			},
			{
				name:"教学大纲",
				url:"teaPro"
			},
			{
				name:"教学设计方案",
				url:"instruDes"
			},
			{
				name:"考核说明",
				url:"examDesc"
			}
		]
	},
	{
		name:"答疑管理",
		url:"a_tutorMessage"
	},
	{
		name:"考试管理",
		url:"a_examList"
	},
	{
		name:"作业管理",
		url:"a_taskManger"
	},
	{
		name:"学习管理",
		url:"a_tutorOrder"
	},
	{
		name:"消息管理",
		child:[
			{
				name:"发消息",
				url:"newsCreate"
			},
			{
				name:"消息列表",
				url:"newsList"
			}
		]
	},
	{
		name:"评论管理",
		url:"commentManger"
	},
	{
		name:"课程预览",
		url:"coursePreview"
	},
	{
		name:"课程教学",
		url:"courseTeaching"
	},
	{
		name:"课程考核",
		child:[
			{
				name:"课程考核说明",
				url:"courseAssess"
			},
			{
				name:"课程考核结果",
				url:"couAssRes"
			}
		]
	}
	
];
Menu[UTYPE.STUDENT] = [
	{
		name:"课程学习",
		url:"a_indexDetailCourse"
	},
	{
		name:"考试管理",
		url:"a_examList"
	},
	{
		name:"错题集",
		url:"a_examError"
	},
	{
		name:"消息管理",
		url:"newsList"
	}
];
Menu[UTYPE.VISITOR] = [
	{
		name:"课程学习",
		url:"a_indexDetailCourse"
	}
];

var Icon = {
	"首页":"globe",
	"用户管理":"user",
	"课程管理":"book",
	"课程学习":"book",
	"我的课程":"book",
	"订单管理":"shopping-cart",
	"证书管理":"tags",
	"支付管理":"shopping-cart",
	"消息管理":"envelope",
	"考试管理":"th-list",
	"错题集":"remove",
	"学习管理":"bookmark",
	"首页设置":"cog",
	"阶段性作业":"pencil",
	"讲师管理":"th-list",
	"答疑管理":"tags",
	"发票管理":"stamp",
	"作业管理":"ph-task",
	"班级管理":"home",
	"评论管理":"comment",
	"课程预览":"facetime-video",
	"题库管理":"folder-close",
	"专业管理":"tower",
	"支付管理":"usd",
	"专业班级管理":"bell",
	"专业班级公告管理":"bullhorn",
	"专业批次管理":"signal",
	"教学计划管理":"list-alt",
	"文档说明":"file",
	"课程教学":"expand",
	"课程考核":"ok",
	"辅导老师考核":"file"
};


var STATUS_HTML = {};
//STATUS_HTML[STATUS.COMMIT] = '<span class="label label-default">待审核</span>'; //提交
STATUS_HTML[STATUS.COMMIT] = '<div class="zhuangTai sH_3">审核中</div>'; //提交
STATUS_HTML[STATUS.UNCOMMIT] = '<span class="label label-default">未提交</span>'; //未提交
// STATUS_HTML[STATUS.PASS] = '<span class="label-success label label-default">通过</span>'; //通过
// STATUS_HTML[STATUS.REJECT] = '<span class="label-danger label label-default">拒绝</span>'; //拒绝
STATUS_HTML[STATUS.PASS] = '<div class="zhuangTai tG_3">通过</div>'; //通过
STATUS_HTML[STATUS.REJECT] = '<div class="zhuangTai jJ_3">拒绝</div>'; //拒绝
STATUS_HTML[STATUS.UNPUBLISH] = '<span class="label label-default">未发布</span>'; //未提交
STATUS_HTML[STATUS.SHELVES] = '<span class="label-success label label-default">上架</span>'; //上架
STATUS_HTML[STATUS.UNDERCARRIAGE] = '<span class="label-danger label label-default">下架</span>'; //下架
STATUS_HTML[STATUS.UNREAD] = '<span class="label label-default">未读</span>'; //未读
STATUS_HTML[STATUS.READ] = '<span class="label-success label label-default">已读</span>'; //已读
STATUS_HTML[STATUS.VERIFYING] = '<span class="label-info label label-default">审核中</span>'; //审核中
STATUS_HTML[STATUS.ACTIVE] = '<span class="label-success label label-default">激活</span>'; //学员激活
STATUS_HTML[STATUS.UNACTIVE] = '<span class="label label-default">未激活</span>'; //学员未激活
STATUS_HTML[STATUS.CERTIFICATE_COMMIT] = '<span class="label-success label label-default">申请中</span>'; //纸质证书申请
STATUS_HTML[STATUS.CERTIFICATE_PASS] = '<span class="label-success label label-default">通过</span>'; //纸质证书通过
STATUS_HTML[STATUS.CERTIFICATE_REJECT] = '<span class="label-danger label label-default">拒绝</span>'; //纸质证书拒绝
STATUS_HTML[STATUS.CERTIFICATE_FINISH] = '<span class="label-success label label-default">已发放</span>'; //纸质证书发放完
STATUS_HTML[undefined] = '<span class="label label-default">暂无状态</span>'; //无状态
STATUS_HTML[1000] = '<span class="label-success label label-default">首页推荐</span>'; //推荐
STATUS_HTML[1001] = '<span class="label label-default">未推荐</span>'; //纸质证书发放完
STATUS_HTML[false] = '<span class="label-danger label label-default">未发放</span>'; //纸质证书未发放
STATUS_HTML[true] = '<span class="label-success label label-default">已发放</span>'; //纸质证书发放完

var EXAMTYPE = { //试题类型
    SINGLE_CHOICE: 1, //单选，
    MULTIPLE_CHOICE: 2, //多选，
    JUDGE: 3, //判断，
    FILL:4,//填空，
    SUBJECTIVE: 5, //5：问答，
    LIGATURE: 6, //连线（匹配）,
    SORT: 7 //排序,
};
var EXAMTYPE_LABEL = { //试题类型
    1: "单选题", //单选，
    2: "多选题", //多选，
    3: "判断题", //判断，
    4: "填空题",//填空，
    5: "问答题", //5：问答，
    6: "连线题", //连线（匹配）,
    7: "排序题" //排序,
};

var noBuyCertificati = [//部分证书 不能购买
	"5552b7d3b0b0e9bd66fc6d2c",
	"5552bae0b0b0e9bd66fc6d2d",
	"550a90e96870af4e1c113b4d",
	"550a941e6870af4e1c113b4f",
	"550a6462dd5c26c3175efd4b"	
];

// 模板代码
// html += '<table class="table table-bordered"><thead><tr>'+
//             '<th>邮箱</th>'+
//             '<th>名字</th>'+
//             '<th>电话</th>'+
//             '<th>操作</th>'+
//         '</tr></thead><tbody>';

// html += '<tr>'+
// 			'<td>'+ items[i] +'</td>'+
// 		'</tr>';


// html += '</tbody></table>';